<template>
  <div class="cascader-bar-dialog">
    <a-modal v-model="visible" title="选项设置" @cancel="cancel" @ok="confirm" :destroyOnClose="true">
      <CascaderBar ref="CascaderBar" :data.sync="formData">
      </CascaderBar>
    </a-modal>
  </div>
</template>

<script>
export default {
  name: 'CascaderDialog',
  data() {
    return {
      visible: false,
      formData: []
    }
  },
  mounted() {},

  methods: {
    show(data) {
      this.formData = data
      this.visible = true
    },
    cancel() {
      this.visible = false
      this.$emit('confirm', this.$refs.CascaderBar.cancel())
    },
    confirm() {
      this.visible = false
      this.$emit('confirm', this.$refs.CascaderBar.confirm())
    }
  }
}
</script>

<style lang="less" scoped>
/deep/.ant-modal {
  width: fit-content !important;
}
.cascader-bar-dialog {
    // min-width: 520px;
}
</style>